package com.ruoyi.mymod.service.impl;

import com.ruoyi.mymod.service.IChickenService;
import com.ruoyi.mymod.service.IFeedAccessService;
import com.ruoyi.mymod.utils.Dbutil;
import com.ruoyi.mymod.utils.Dbutil.Qp;
import org.springframework.stereotype.Service;

@Service
public class ChickenServiceImpl implements IChickenService {

    @Override
    public String getPriceRation() {
        Dbutil.R r=null;
        Qp qp=null;
        try {

            qp = new Qp();
            Object o= qp.setUsrpwd("ctcnfd","ctcnfd").func(4,"app.mtlpriceratio");
            r=(Dbutil.R) o;

        }finally {
            qp.closeConn();
        }
        return r.json;
    }

    @Override
    public String doCalnutrition(String str,String growtype) {
        Dbutil.R r=null;
        Qp qp=null;
        try {
            qp = new Qp();
            Object o= qp.setUsrpwd("ctcnfd","ctcnfd").setP(str,growtype).funcP(4,"app.calnutrition");
            r=(Dbutil.R) o;

        }finally {
            qp.closeConn();
        }
        return r.json;
    }

    @Override
    public String getFeedtype() {
        Dbutil.R r=null;
        Qp qp=null;
        try {
            qp = new Qp();
            Object o= qp.setUsrpwd("ctcnfd","ctcnfd").setSqlStr("select t.code,t.name,t.price,t.ratio from SF_ZG_FM_MTL t order by t.ratio desc,t.sort").select();
            r=(Dbutil.R) o;

        }finally {
            qp.closeConn();
        }
        return r.json;
    }

    @Override
    public String getGrowType() {
        Dbutil.R r=null;
        Qp qp=null;
        try {
            qp = new Qp();
            Object o= qp.setUsrpwd("ctcnfd","ctcnfd").setSqlStr("select t.code,t.name from SF_ZG_FM_STAGE t order by t.sort").select();
            r=(Dbutil.R) o;

        }finally {
            qp.closeConn();
        }
        return r.json;
    }

    @Override
    public String getratioPrice() {
        Dbutil.R r=null;
        Qp qp=null;
        try {
            qp = new Qp();
            Object o= qp.setUsrpwd("ctcnfd","ctcnfd").setSqlStr("select t.name,t.price from SF_ZG_FM_IGD t order by t.sort").select();
            r=(Dbutil.R) o;

        }finally {
            qp.closeConn();
        }
        return r.json;
    }

}
